<template>
  <div class="hello">
    <h2>东软云医院HIS系统</h2>
    <!-- <div>{{msg}}</div> -->

    <el-table :data="msg" style="width: 100%">
      <!-- 查询用户 -->
          <!-- <el-table-column prop="registName" label="号别名称" width="180"></el-table-column>
          <el-table-column prop="registFee"  label="挂号费"   width="180"></el-table-column>
          <el-table-column prop="registQuota"label="挂号数量"></el-table-column> -->
     <!-- 查询所有用户 -->
     <el-table-column prop="userName" label="登录名称" width="180"></el-table-column>
     <el-table-column prop="realName"  label="真实姓名"   width="180"></el-table-column>
     <el-table-column prop="userType"label="用户类型"></el-table-column>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button @click="getIdClick(scope.$index, scope.row)">发送ID</el-button>
            </template>
           </el-table-column>
    </el-table>

    <!-- <el-button @click="submitClick">查询用户</el-button> -->
    <el-button @click="submitClick">查询用户信息</el-button>

   </div>

</template>

<script>
export default {
  name: 'HelloWorld',
  mounted:function(){
    //this.submitClick();
  },
  data () {
    return {
      msg: []
    }
  },
  methods:{
    /* 查询用户 */
    /* submitClick(){
      let _this = this;
      alert("您好，欢迎进行测试！")
      this.$axios.get("/neuhis/user/toadd")
      .then(response =>{
        _this.msg = response.data.regList;
      });
    } ,*/
    /* 查询用户信息 */
    submitClick(){
      let _this = this;
      alert("您好，欢迎进行测试！")
      this.$axios.get("/neuhis/user/queryAllUser")
      .then(response =>{
        _this.msg = response.data;
      });
    },

    getIdClick(index,row){
      let _this = this;
      this.$axios.get("/neuhis/user/update",{
        params:{
          id:this.msg[index].id
        }
      })
      .then(response =>{
        alert("OK");
      });
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
